package com.sukaiyi.generator.ui.base;

import com.sukaiyi.generator.utils.ProjectUtils;
import com.intellij.openapi.ui.DialogWrapper;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

public class ConfirmationDialog extends DialogWrapper {

    private JPanel rootPanel;
    private JLabel tipsLabel;
    public ConfirmationDialog() {
        super(ProjectUtils.getProject());
        this.init();
        this.setTitle("Confirm");
    }

    public ConfirmationDialog(String title, String message) {
        super(ProjectUtils.getProject());
        this.init();
        this.setTitle(title);
        tipsLabel.setText(message);
    }

    public void setTitle(String title) {
        super.setTitle(title);
    }

    public void setMessage(String message) {
        tipsLabel.setText(message);
    }

    @Nullable
    @Override
    protected JComponent createCenterPanel() {
        return rootPanel;
    }
}
